//
//  CUTimeFormat.swift
//  Hyphenate-Demo-Swift
//
//  Created by curtainup on 2019-01-07.
//  Copyright © 2019 curtainups. All rights reserved.
//

import Foundation

class CUTimeFormat: NSObject{
static func get12Time(time: String)->String{
    var _time = time;
    if(_time == "24:00"){
        _time = "00:00"
    }
    if(_time == ""){
        return _time;
    }
    let dateFormatter = DateFormatter()
    dateFormatter.dateFormat = "HH:mm"
    let start  = dateFormatter.date(from: _time)
    dateFormatter.dateFormat = "h:mm a"
    return dateFormatter.string(from: start!)
}
}
